﻿using System;
using Landpy.CruiseControlNet.FacadeInterface.ConfigurationModule;
using Landpy.CruiseControlNet.FacadeInterface.RepositoryModule;
using Landpy.CruiseControlNet.Infrastructure.Aop.WrapAttribute;

namespace Landpy.CruiseControlNet.DomainLayer.RepositoryModule
{
    public class SourceControlRepository : ISourceControlRepository
    {
        private IProjectRepository ProjectRepository { get; set; }

        public SourceControlRepository()
        {
            this.ProjectRepository = new ProjectRepository();
        }

        [NotThrowException]
        [ExceptionMessageBox]
        [LogException]
        public SourceControl GetSourceControlById(CruiseControl cruiseControl, Guid projectId)
        {
            return this.ProjectRepository.GetProjectById(cruiseControl, projectId).SourceControl;
        }
    }
}